package com.example.qxfw.yjqx.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.qxfw.common.entity.yj.Emergency;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.sql.Timestamp;
import java.util.List;

@Mapper
@DS("service")
public interface EmergencyMapper extends BaseMapper<Emergency> {

    @Select("select max(id) as id from emergency ")
    String getMaxId();

    @Select("select id, datetime, title, type, address, longitude, latitude, docpath " +
            "from emergency " +
            "where type LIKE #{type} AND datetime Between #{time1} and #{time2} ")
    List<Emergency> selectList1(@Param("type") String type, @Param("time1")Timestamp time1,@Param("time2") Timestamp time2);


    @Select("select Docpath " +
            "from emergency " +
            "where id = #{id}")
    List<String> selectDocPath(String id);

}
